package com.enqualcomm.kids.view;

import android.content.Context;
import android.support.v4.view.ViewPager;
import android.util.AttributeSet;
import android.view.MotionEvent;
import android.view.View;

/**
 * Created by Sunzhigang on 2016/11/1.
 */

public class HeaderViewPager extends ViewPager{
    private boolean mViewEnable = true;
    public HeaderViewPager(Context context) {
        super(context);
    }

    public HeaderViewPager(Context context, AttributeSet attrs) {
        super(context, attrs);
    }

    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        mViewEnable = enabled;
    }

    @Override
    public boolean dispatchTouchEvent(MotionEvent ev) {
        if (mViewEnable){
            return super.dispatchTouchEvent(ev);
        }else {
            return true;
        }


    }
}
